// <%--onload创建页面判断是否切换到信息上传页面--%>
function initParameter2(openInputView,asideStatus){
    //  侧边栏初始点击
    var aside1 = document.getElementById("aside1");
    var aside2 = document.getElementById("aside2");

    var item1 = document.getElementById("item1");
    var item2 = document.getElementById("item2");

    aside1.classList.remove("aside1");
    aside2.classList.remove("aside2");

    item1.style.display = "none";
    item2.style.display = "none";


    if (asideStatus === 1){
        aside1.classList.add("current");
        item1.style.display = "block";
    }else if (asideStatus === 2) {
        aside2.classList.add("current");
        item2.style.display = "block";
    }else {
        aside1.classList.add("current");
        item1.style.display = "block";
    }
    var inputView = document.getElementById("inputView"); // 新界面的表单
    // item1 = document.getElementById("item1");  // 数据上传查询界面
    if (openInputView === 2){
        inputView.style.display = "block";   // 设置表单界面为显示状态
        item1.style.display = "none";  // 设置数据上传查询界面为不可见状态
    }
}
//搜索用户下拉框变化的时候发送请求
function clickOption2(){
    var userIdSelect = document.getElementById("userIdSelect");
    // 拿出选中项索引
    var selectedIndex = userIdSelect.selectedIndex;

    let id = userIdSelect.options[selectedIndex].id;
    window.location.href = "searchDataByUser?userId="+id+"&index="+selectedIndex+"&type=1";
    window.event.returnValue=false; //return false是阻止游览器对事件的默认处理
}

//搜索套餐小项下拉框变化的时候发送请求
// index:用户下拉框索引锁定请求
function clickOption3(userId,index){
    var itemSelect = document.getElementById("itemSelect");
    // 拿出选中项索引
    var selectedIndex1 = itemSelect.selectedIndex;

    let id = itemSelect.options[selectedIndex1].id;
    let value = itemSelect.options[selectedIndex1].value;
    window.location.href = "searchDataByCombo?examineId="+id+"&index1="+selectedIndex1+"&type=2&userId="+userId+"&index="+index+"&value="+value;
    window.event.returnValue=false; //return false是阻止游览器对事件的默认处理
}

    // <%--点击上传发送请求--%>
    function clickUpdate(tableRow,userId,examineDate){
    var tableAdmin = document.getElementById("tableAdmin");
    var attributeId = tableAdmin.rows[tableRow+1].cells[2].innerText;
    window.location.href = "inputAttribute?attributeId="+attributeId+"&userId="+userId+"&examineDate="+examineDate;
}

    // <%--点击上传页面的确认上传发送的请求--%>
    function clickInput(userId,attributeId,examineDate){
    var attributeText = document.getElementById("attributeText").value;
    window.location.href = "inputData?userId="+userId+"&attributeId="+attributeId+"&examineDate="+examineDate+"&attributeText="+attributeText;
}


function  updateHealthAttributesByChekedInput(id){

    window.location.href="/ComboAddServlet?id="+id+"&serviceType=2";

}